<?php

namespace  Application\Model;

use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;

class OrderProduct implements InputFilterAwareInterface {

    public $id;
    public $product_id;
    public $total_item;
    public $price;
    public $order_id;
    public $security_code;
    public $total_download;


    protected $inputFilter;

    public function exchangeArray($data) {
        $this->id = (isset($data['id'])) ? $data['id'] : null;
        $this->product_id = (isset($data['product_id'])) ? $data['product_id'] : null;
        $this->total_item = (isset($data['total_item'])) ? $data['total_item'] : null;
        $this->price = (isset($data['price'])) ? $data['price'] : null;
        $this->order_id = (isset($data['order_id'])) ? $data['order_id'] : null;
        $this->security_code = (isset($data['security_code'])) ? $data['security_code'] : null;
        $this->total_download = (isset($data['total_download'])) ? $data['total_download'] : null;




    }

    public function getArrayCopy() {
        return get_object_vars($this);
    }

    public function setInputFilter(InputFilterInterface $inputFilter) {
        $this->inputFilter = $inputFilter;
//            throw new \Exception("Not used");
    }

    public function getInputFilter() {
        if (!$this->inputFilter) {
			$inputFilter = new InputFilter();
			$factory     = new InputFactory();


			$inputFilter->add($factory->createInput(array(
					'total_item'     => 'content',
					'required' => true,
			)));
			$this->inputFilter = $inputFilter;
		}

		return $this->inputFilter;
    }

}